<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>sample</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function  </center>
    <div align="right">Last update : 14/10/2003</div>
    <p>
      <b>sample</b> -   Sampling with replacement</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>s = sample(n,X,orient)</tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>n</b>
        </tt>: positive integer (size of sample)</li>
      <li>
        <tt>
          <b>X</b>
        </tt>: matrix. Samples will be extracted from this matrix.</li>
      <li>
        <tt>
          <b>orient</b>
        </tt>: Optional parameter. Admissible values are 1, 2, 'r' or 'c'</li>
      <li>
        <tt>
          <b>s</b>
        </tt>: vector or matrix containing sample</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
     This function gives a  vector (or matrix) nx1. It contains
     a random  sample of n extractions,  with replacement, from
     the matrix X.
</p>
    <p>
     s=sample(n,X)  (or s=sample(n,X,'*'))  returns a  vector s
     whose  values are  a random  sample  of n  values from  X,
     extracted with replacement, from X .
</p>
    <p>

     s=sample(n,X,'r')   (or,   equivalently,  s=sample(n,X,1))
     returns  a matrix  of type  size(X,'r')xn.  It  contains a
     random sample of n  rows, extracted with replacement, from
     the rows of X.
</p>
    <p>

     s=sample(n,X,'c')   (or,   equivalently,  s=sample(n,X,2))
     returns  a matrix  of type  nxsize(X,'c').  It  contains a
     random  sample of  n columns,  extracted  with replacement
     from the columns of X.
</p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>
X=['a' 'dd' 'arreu'; 'ber' 'car' 'zon']
s=sample(25,X)
s=sample(25,X,'r')
s=sample(25,X,'c')
  </pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="samplef.htm">
        <tt>
          <b>samplef</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="samwr.htm">
        <tt>
          <b>samwr</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
    <h3>
      <font color="blue">Author</font>
    </h3>
    <p>
    Carlos Klimann
  </p>
  </body>
</html>
